package Util;
import java.sql.*;
public class DatabaseConn {
	public DatabaseConn() {
	}
  public static Connection getConnection(){
	  Connection conn=null;
	  String driverClass="com.mysql.jdbc.Driver";
	  String url="jdbc:mysql://localhost:3306/hospitalg";
	  String user="root";
	  String password="123456";
	   try{
		   Class.forName(driverClass);
		   conn=DriverManager.getConnection(url,user,password);
	   }catch (Exception ex){
		     ex.printStackTrace();
	   }
	   return conn;
	   }
  public  static void closeConn(Connection conn){
	  if(conn!=null){
		  try{
			  conn.close();
		  }catch(SQLException ex){
			  ex.printStackTrace();
		  }
	  }}
  }